package Fenetres;

import java.io.File;

import javax.swing.filechooser.FileFilter;

public class Filtre extends FileFilter {

	private String extension;
	private String description;

	public Filtre(String description, String extension) {
		this.description = description;
		this.extension = extension;
	}

	public boolean accept(File f) {
		if (f.isDirectory())
			return true;

		String fileName = f.getName().toLowerCase();
		return fileName.endsWith(extension);
	}

	public String getDescription() {
		return description;
	}

}
